package com.ehotting.edsta.diagnosisPredict.feign;

import com.ehotting.eaf.core.web.domain.diagnosisPredict.Response;
import com.ehotting.edsta.diagnosisPredict.domain.dto.FeOperator;
import com.ehotting.edsta.diagnosisPredict.domain.dto.FeProcessingTreeDto;
import com.ehotting.edsta.diagnosisPredict.feign.factory.FeOperatorFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 特征算子FeignClient
 */
@FeignClient(name = "feOperator", url = "${request.url.prefix}/feOperator",fallbackFactory = FeOperatorFallbackFactory.class)
public interface FeOperatorFeignService {
    /**
     * 特征算子字段列表
     *
     * @return
     */
    @GetMapping(value = "/list")
    Response<List<FeOperator>> list(@RequestParam("canvasld") Long canvasld,
                                    @RequestParam("coordinate") String coordinate,
                                    @RequestParam("createTime") String createTime,
                                    @RequestParam("id") Long id,
                                    @RequestParam("iteminfold") Long iteminfold,
                                    @RequestParam("itemname") String itemname,
                                    @RequestParam("menuId") Long menuId,
                                    @RequestParam("operatorType") String operatorType,
                                    @RequestParam("operatorname") String operatorname,
                                    @RequestParam("pid") Long pid);

    /**
     * 特征算子字段列表
     *
     * @return
     */
    @GetMapping(value = "/getTree")
    Response<List<FeProcessingTreeDto>> getTree(@RequestParam("canvasld") Long canvasld);

    /**
     * 新建数据处理算子
     *
     * @return
     */
    @PostMapping(value = "/save")
    Response<FeOperator> save(@RequestBody FeOperator feOperator);

    /**
     * 算子执行
     *
     * @return
     */
    @PostMapping(value = "/exec")
    Response<Map<String,String>> exec(@RequestBody FeOperator feOperator);

    /**
     * 算子打开获取数据结果
     *
     * @return
     */
    @PostMapping(value = "/getCacheById")
    Response<Map<String,String>> getCacheById(@RequestParam("id") String id);

}
